package com.desuntech.utils
{
	import flash.events.Event;
	import flash.net.FileReference;

	public class TraceLog
	{
		private static var _tl:TraceLog;
		private static var _status:String;
		
		public static function getInstance():TraceLog {
			if (_tl == null)
				_tl = new TraceLog();
			return _tl;
		}
		
		public function log(value:String):void {
			trace((new Date()).toString() + ' ' + value);
			_status += '\n' + (new Date()).toString() + ' ' + value;
		}
		
		public function saveLog():void {
			var fr:FileReference = new FileReference();
			fr.save(_status, 'log.txt');
		}
	}
}